import axios from '../request';
import { DesignType, ModuleSaveInfo } from '../model/desgin';
// 项目展品分页
export const designList = (params: DesignType) => {
  // 返回的数据格式可以和服务端约定
  return axios.get<any>(`api/exhibition/list/${params.projectId}`, params);
};
//项目展品数量
export const exhibtNumber = (params: DesignType) => {
  // 返回的数据格式可以和服务端约定
  return axios.get<any>(`api/exhibition/showpieceNumber/${params.projectId}`, params);
};
//添加项目展品
export const addExhibits = (projectId: number | string, moduleId: number, parmas: Array<Number>) => {
  return axios.post<any>(`api/exhibition/showpieces/${projectId}/${moduleId}`, parmas);
};
//删除项目展品
export const exhibitRemove = (projectId: number | string, exhibitId: number) => {
  return axios.delete<any>(`api/exhibition/showpiece/${projectId}/${exhibitId}`, {});
};
//删除项目展品
export const disassociateRemove = (projectId: number | string, exhibitId: number) => {
  return axios.put<any>(`api/exhibition/disassociate/${projectId}/${exhibitId}`, {});
};
//展览单元排序
export const disableSort = (projectId: number | string, parentId: number, pramas: Array<Number>) => {
  return axios.put<any>(`api/exhibition/sortModule/${projectId}/${parentId}`, pramas);
};
//删除单元
export const moduleDelete = (projectId: number | string, moduleId: number) => {
  return axios.delete<any>(`api/exhibition/module/${projectId}/${moduleId}`, {});
};
//保存单元
export const moduleSave = (projectId: number | string, parmas: ModuleSaveInfo) => {
  return axios.post<any>(`api/exhibition/module/${projectId}`, parmas);
};
//保存单元按字段更新
export const moduleSaveInfo = (projectId: number | string, moduleId: number | string, parmas: any) => {
  return axios.patch<any>(`api/exhibition/module/${projectId}/${moduleId}`, parmas);
};
//单元列表
export const moduleList = (projectId: number | string) => {
  return axios.get<any>(`api/exhibition/moduleList/${projectId}`, {});
};
//获取单元详情
export const moduleInfo = (moduleId: number) => {
  return axios.get<any>(`api/exhibition/module/${moduleId}`, {});
};
//解除项目关联
export const disassociate = (projectId: number | string, showpieceId: number) => {
  return axios.put<any>(`api/exhibition/disassociate/${projectId}/${showpieceId}`, {});
};
export const designList11 = (params: DesignType) => {
  // 返回的数据格式可以和服务端约定
  return axios.get<any>(`api/exhibition/baseList/${params.projectId}`, params);
};
//辅助信息展品数量projectId项目id moduleId单元id
export const auxiliaryNumbers = (projectId: number | string, moduleId: number) => {
  return axios.get<any>(`api/exhibition/auxiliaryNumbers/${projectId}/${moduleId}`, {});
};

// 项目展品单元分页
export const exhibitiondatas = (params: DesignType, modelId) => {
  // 返回的数据格式可以和服务端约定
  return axios.get<any>(`api/exhibition/data/${params.projectId}/${modelId}`, params);
};
//不包含辅助信息展品
export const moduleShowpieces = (params: any) => {
  // 返回的数据格式可以和服务端约定
  return axios.get<any>(`api/exhibition/moduleShowpieces/${params.projectId}`, params);
};
